package com.example.a12769.myapplication.base;

import android.app.Activity;
import android.app.Application;
import android.content.Context;

import java.util.LinkedList;
import java.util.List;

public class MyApplication extends Application {
    public static List<Activity> activityList = new LinkedList();
    static Context mcontext;
    @Override
    public void onCreate() {
        super.onCreate();
        mcontext=getApplicationContext();
    }

    public static Context getInstance() {
        return mcontext;
    }
    public static void addActivity(Activity activity){
        activityList.add(activity);
    }
    public  static void finishAll(){
        for (int i = 0; i < MyApplication.activityList.size(); i++) {
            MyApplication.activityList.get(i).finish();
        }
    }
}
